﻿using System.Collections.Generic;
using BoldBrick.OneIntranet.HR.Properties;
using BoldBrick.SharePoint.CommonControls.DataObjects.Base;

namespace BoldBrick.OneIntranet.HR.DataObjects.ContentTypes.TasksContentTypes
{
	/// <summary>
	/// Base content type for all HR Task content types
	/// </summary>
	public class HRTaskContentType : BaseContentType
	{
		#region ------ Content Type ID ------------------------------------------------------------

		protected override string GetContentTypeID()
		{
			return Settings.Default.ContentType_HRTask_ID;
		}

		#endregion

		#region ------ Columns --------------------------------------------------------------------

		public override List<ListColumn> GetListColumns()
		{
			List<ListColumn> columns = new List<ListColumn>
			                           	{
											SiteColumns.ResultSummaryColumn,
											SiteColumns.CandidateResultColumn
			                           	};

			// add child columns
			columns.AddRange(GetChildListColumns());

			// add rest of parent columns

			return columns;
		}

		public override List<ListColumn> GetOrderedListColumns()
		{
			List<ListColumn> columns = new List<ListColumn>
			                           	{
			                           		SharePoint.CommonControls.DataObjects.SiteColumns.TitleColumn,
			                           		SharePoint.CommonControls.DataObjects.SiteColumns.BodyColumn,
											SharePoint.CommonControls.DataObjects.SiteColumns.AssignedToColumn,
											SharePoint.CommonControls.DataObjects.SiteColumns.PercentCompleteColumn,
											SiteColumns.CandidateResultColumn,
											SiteColumns.ResultSummaryColumn
			                           	};

			columns.AddRange(GetChildOrderedListColumns());

			
			columns.Add(SharePoint.CommonControls.DataObjects.SiteColumns.StartDateColumn);
			columns.Add(SharePoint.CommonControls.DataObjects.SiteColumns.TaskDueDateColumn);
			columns.Add(SharePoint.CommonControls.DataObjects.SiteColumns.PriorityColumn);
			columns.Add(SharePoint.CommonControls.DataObjects.SiteColumns.StatusColumn);
			

			return columns;

		}

		/// <summary>
		/// Gets ordered columns in child content type
		/// </summary>
		/// <returns>Returns ordered columns in child content type</returns>
		protected virtual List<ListColumn> GetChildOrderedListColumns()
		{
			return GetChildListColumns();
		}

		/// <summary>
		/// Gets columns in child content type
		/// </summary>
		/// <returns>Returns columns in child content type</returns>
		protected virtual List<ListColumn> GetChildListColumns()
		{
			return new List<ListColumn>();
		}

		#endregion

		protected override string GetNameResourceKey()
		{
			return "ContentType_HRTask_Name";
		}

		protected override string GetDescriptionResourceKey()
		{
			return "ContentType_HRTask_Description";
		}
	}
}
